import java.io.*;
import java.util.StringTokenizer;

public class Buying_Hay_S {
    public static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static Read in = new Read();
    public static int MAXN = 101;
    public static int MAXH = 55001;
    public static int n,h,m;
    public static int[][] arr = new int[MAXN][2]; // [0] 份数 [1] 钱
    public static int dp[][] = new int[MAXN][MAXH];
    public static void main(String[] args) throws IOException {
        n = in.nextInt();
        h = in.nextInt();
        m = 0;
        for (int i = 1; i <= n; i++) {
            arr[i][0] = in.nextInt();
            arr[i][1] = in.nextInt();
            m = Math.max(arr[i][0],m);
        }
        m += h;
        out.print(compute());
        out.close();
    }

    private static int compute() {
        for (int j = 1; j <= m; j++) {
            dp[0][j] = Integer.MAX_VALUE;
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j <= m; j++) {
                // 当前这个不选
                dp[i][j] = dp[i - 1][j];
                // 当前这个选
                if (j - arr[i][0] >= 0 && dp[i][j - arr[i][0]] != Integer.MAX_VALUE) {
                    dp[i][j] = Math.min(dp[i][j],dp[i][j - arr[i][0]] + arr[i][1]);
                }
            }
        }
        int ans = Integer.MAX_VALUE;
        for (int i = h; i <= m; i++) {
            ans = Math.min(ans,dp[n][i]);
        }
        return ans;
    }


    public static class Read // 自定义快速读入
    {
        StringTokenizer st = new StringTokenizer("");
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String next() throws IOException
        {
            while(!st.hasMoreTokens())
            {
                st = new StringTokenizer(bf.readLine());
            }
            return st.nextToken();
        }

        String nextLine() throws IOException
        {
            return bf.readLine();
        }

        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
}
